home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q1082.dms / q1082.adf / src.lzh / Fig / resources.h < prev    next >
C/C++ Source or Header  |  1991-07-18  |  5KB  |  238 lines

  1. /* 
  2.  *    FIG : Facility for Interactive Generation of figures
  3.  *
  4.  *    Copyright (c) 1985 by Supoj Sutanthavibul (supoj@sally.UTEXAS.EDU)
  5.  *    January 1985.
  6.  *    1st revision : Aug 1985.
  7.  *
  8.  *    %W%    %G%
  9. */
  10. #ifdef    GLOBAL_DATA
  11. #define    EXTERN
  12. #else
  13. #define    EXTERN    extern
  14. #endif
  15.  
  16. #ifdef    X11
  17. typedef struct
  18. {
  19.     unsigned int    x, y, z;
  20.     caddr_t        *m;
  21. } MprData;
  22.  
  23. #define    mpr_static(name,x,y,z,pix)    \
  24. XImage name    = \
  25. { \
  26. (x), (y), 0, XYBitmap, (char *)(pix),\
  27. MSBFirst, 8, MSBFirst, 8, (z), (x+7)/8, 1, 0, 0, 0, NULL \
  28. }
  29.  
  30. typedef struct
  31. {
  32.     int        x, y;
  33. } pr_size;
  34.  
  35. typedef struct
  36. {
  37.     unsigned int    hotx, hoty;
  38.     unsigned int    graphop;
  39.     XImage        *bitmap;
  40. } CursorRec;
  41.  
  42. typedef struct
  43. {
  44.     unsigned int    r_width, r_height, r_left, r_top;
  45. } RectRec;
  46.  
  47. typedef struct
  48. {
  49.     int        type;
  50.     char        *label;
  51.     caddr_t        info;
  52. } MenuItemRec;
  53.  
  54. struct Menu
  55. {
  56.     int        m_imagetype;
  57. #define    MENU_IMAGESTRING    0x00    /* imagedata is char * */
  58. #define MENU_GRAPHIC            0x01    /* imagedata is pixrect * */
  59.     caddr_t        m_imagedata;
  60.     int        m_itemcount;
  61.     MenuItemRec    *m_items;
  62.     struct Menu    *m_next;
  63.     caddr_t        m_data;
  64. };
  65.  
  66. typedef    struct Menu    MenuRec;
  67. #endif    X11
  68.  
  69. #ifndef    X11
  70. #ifdef AMIGA
  71. /*#include "graphics/text.h"*/
  72. struct iconpic {
  73. int xlen,ylen;
  74. int depth;
  75. USHORT * data;};
  76.  
  77. struct cursor {
  78. int actx,acty;
  79. int drawingmode;
  80. struct iconpic * picture;};
  81.  
  82. #define mpr_static(a,b,c,d,e) \
  83. struct iconpic a =\
  84. {b,c,d,(USHORT *)e}
  85.  
  86. struct pixrect{
  87. char * data;};
  88. struct mpr_data{
  89. char * a;};
  90. struct tool{
  91. char * b;};
  92. struct toolsw{
  93. char * c;};
  94. struct pr_size{
  95. int x,y;};
  96. struct fontdims{
  97. int x,y;};
  98.  
  99. struct chardata {
  100. struct fontdims pc_adv;
  101. char * pc_data; };
  102.  
  103. struct pixfont{
  104. struct fontdims pf_defaultsize;
  105. struct chardata *pf_char;
  106. };
  107. struct MyMenuItem{
  108. int dummy;
  109. char * ptr;
  110. caddr_t code;};
  111.  
  112. typedef        struct Window        pixwin;
  113. typedef        struct Window *     PIXWIN;
  114. typedef        struct cursor        CURSORREC;
  115. typedef        struct cursor *        CURSOR;
  116. typedef        struct pixrect        PIXRECTREC;
  117. typedef        struct TextFont *    PIX_FONT;
  118. typedef        short *    PIXRECT;
  119. typedef        struct mpr_data     MPR_DATA;
  120. typedef        struct tool *        TOOL;
  121. typedef        struct toolsw *     TOOLSW;
  122. typedef        int                    FDTYPE;
  123. typedef        struct IntuiMessage    INPUTEVENT;
  124. typedef        struct inputmask    INPUTMASK;
  125. typedef        struct pr_size        PR_SIZE;
  126. typedef        struct Rectangle    RECT;
  127. typedef        struct MyMenuItem    MENUITEM;
  128. typedef        struct Menu            MENU;
  129. #else
  130. typedef        struct pixwin *        PIXWIN;
  131. typedef        struct pixrect        PIXRECTREC;
  132. typedef        struct pixrect *    PIXRECT;
  133. typedef        struct font *    PIX_FONT;
  134. /* pixrect/pixfont.h already took PIXFONT, foo! */
  135. typedef        struct mpr_data        MPR_DATA;
  136. typedef        struct cursor        CURSORREC;
  137. typedef        struct cursor *        CURSOR;
  138. typedef        struct tool *        TOOL;
  139. typedef        struct toolsw *        TOOLSW;
  140. typedef        struct WINDOW *        FDTYPE;
  141. typedef        struct inputevent    INPUTEVENT;
  142. typedef        struct inputmask    INPUTMASK;
  143. typedef        struct pr_size        PR_SIZE;
  144. typedef        struct rect        RECT;
  145. typedef        struct menuitem        MENUITEM;
  146. typedef        struct menu        MENU;
  147. #endif
  148. #else
  149. typedef        Window            PIXWIN;
  150. typedef        XImage            PIXRECTREC;
  151. typedef        XImage *        PIXRECT;
  152. typedef        XFontStruct *        PIX_FONT;
  153. typedef        MprData            MPR_DATA;
  154. typedef        CursorRec        CURSORREC;
  155. typedef        CursorRec *        CURSOR;
  156. typedef        Widget            TOOL;
  157. typedef        Widget            TOOLSW;
  158. typedef        Window            FDTYPE;
  159. typedef        XButtonEvent        INPUTEVENT;
  160. typedef        unsigned long        INPUTMASK;
  161. typedef        pr_size            PR_SIZE;
  162. typedef        RectRec            RECT;
  163. typedef        MenuItemRec        MENUITEM;
  164. typedef        MenuRec            MENU;
  165. #endif    X11
  166.  
  167. #ifndef    X11
  168. #ifdef AMIGA
  169. extern struct RastPort * RastPort;
  170. #else
  171. #define    set_marker(win,x,y,w,h,op,pix,z1,z2) \
  172.     pw_write((win),(x),(y),(w),(h),(op),(pix),(z1),(z2))
  173. #endif AMIGA
  174. #else
  175. #define    set_marker(win,x,y,w,h,op,pix,z1,z2) \
  176.     XDrawRectangle(tool_d,(win),gccache[(op)],(x),(y),(w),(h))
  177. #endif    X11
  178.  
  179. EXTERN PIXWIN        canvas_pixwin,
  180.             msg_pixwin,
  181.             panel_pixwin,
  182.             sideruler_pixwin,
  183.             topruler_pixwin;
  184.  
  185. extern CURSOR        cur_cursor;
  186. extern CURSORREC    arrow_cursor,
  187.             bull_cursor,
  188.             buster_cursor,
  189.             crosshair_cursor,
  190.             null_cursor,
  191.             pencil_cursor,
  192.             pick15_cursor,
  193.             pick9_cursor,
  194.             wait_cursor;
  195. extern TOOL        tool;
  196.  
  197. EXTERN TOOLSW        canvas_sw,
  198.             msg_sw,
  199.             panel_sw,
  200.             sideruler_sw,
  201.             topruler_sw;
  202.  
  203. EXTERN FDTYPE        canvas_swfd,
  204.             panel_swfd,
  205.             msgswfd,
  206.             trswfd,
  207.             srswfd;
  208.  
  209. #ifdef    X11
  210. EXTERN Display        *tool_d;
  211. EXTERN Screen        *tool_s;
  212. EXTERN int        tool_sn;
  213. EXTERN GC        gc, gccache[0x10], topgc, sidegc;
  214. EXTERN XColor        x_fg_color, x_bg_color;
  215.  
  216. struct icon {
  217.     short         ic_width, ic_height;    /* overall icon dimensions */
  218.     PIXRECT         ic_background;    /* background pattern (mem pixrect) */
  219.     RECT        ic_gfxrect;    /* where the graphic goes */
  220.     PIXRECT     ic_mpr;        /* the graphic (a memory pixrect) */
  221.     RECT        ic_textrect;    /* where text goes */
  222.     char           *ic_text;    /* the text */
  223.     PIX_FONT     ic_font;    /* Font with which to display text */
  224.     int        ic_flags;
  225. };
  226.  
  227. /* flag values */
  228. #define    ICON_BKGRDPAT    0x02        /* use ic_background to prepare image*/
  229. #define    ICON_BKGRDGRY    0x04        /* use std gray to prepare image*/
  230. #define    ICON_BKGRDCLR    0x08        /* clear to prepare image*/
  231. #define    ICON_BKGRDSET    0x10        /* set to prepare image*/
  232. #define    ICON_FIRSTPRIV    0x0100        /* start of private flags range */
  233. #define    ICON_LASTPRIV    0x8000        /* end of private flags range */
  234.  
  235. #include "xtra.h"
  236.  
  237. #endif    X11
  238.